/**
 * Created by Administrator on 2017/10/17.
 */
var mongoose = require('mongoose');
var mongoosePaginate = require('mongoose-paginate');

var Schema = mongoose.Schema;
// var time;
// function getTime() {
// 	var d=new Date();
// 	var m1="/";
// 	var m2=":";
// 	var time=d.getFullYear()+m1+parseInt(d.getMonth()+1)+m1+d.getDate()+" "+d.getHours()+m2+d.getMinutes();
// 	return time;
// }
// var d=new Date();
// var m1="/";
// var m2=":";
// var time=d.getFullYear()+m1+parseInt(d.getMonth()+1)+m1+d.getDate()+" "+d.getHours()+m2+d.getMinutes();
var NewsSchema=new Schema({
	title:String,
	content:String,
	castId:String,
	date:String,
	num:{type:Number,default:0}
})
NewsSchema.plugin(mongoosePaginate);

module.exports=mongoose.model('News',NewsSchema,'news');